<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>抢购商品列表</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		.table td {
			vertical-align: middle;
		}
	</style>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#listForm").validate({
				submitHandler: function(form){
					if($(".activityProducts").length==0){
						showJBoxMess("没有可保存的数据.","error");
						return;
					}
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
<form:form id="listForm" modelAttribute="activityTime" action="${ctx}/ivm/business/activity/productListshow" method="post">
	<tags:message content="${message}"/>
	<input type="hidden" id="merchantId" name="merchantId" value="${activity.merchant.id }" />
	<input type="hidden" id="activityId" name="activityId" value="${activity.id }" />
	<form:hidden path="id"/>
	<input type="hidden" id="timeId" name="timeId" value="${timeId }"/>
	<div style="margin:10px;">
		<div class="breadcrumb form-search">
			<input id="searchParam" name="searchParam" type="text" value="${searchParam }" style="width: 230px;" placeholder="请输入商品编号或商品名称"/>
			&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
		</div>
		<table id="contentTable" class="table table-bordered table-condensed">
			<thead>
				<tr>
					<th width="95">商品封面</th>
					<th>商品名称</th>
					<th>商品规格</th>
					<th>原价</th>
					<th>抢购价</th>
					<th>可购数量</th>
					<th>售出比例</th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${activityTime.productList}" var="activityProduct" varStatus="vs">
				<tr class="activityProducts">
					<td><img id="photo" src="${ctx}/download?filePath=${activityProduct.product.logoUrl }" style="width:95px; height:67px;" /></td>
					<td>${activityProduct.product.name }</td>
					<td>${activityProduct.product.assisTitle }</td>
					<td>${activityProduct.product.price}元</td>
					<td>${activityProduct.price }元</td>
					<td>${activityProduct.number }件</td>
					<td>${activityProduct.ratio }%</td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
	</div>
</form:form>
</body>
</html>